<!DOCTYPE html>
<!--
Copyright (c) 2013 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->

<link rel="import" href="/tracing/core/test_utils.html">
<link rel="import" href="/tracing/model/event_set.html">
<link rel="import" href="/tracing/model/model.html">
<link rel="import" href="/tracing/ui/analysis/analysis_view.html">

<script>
'use strict';

tr.b.unittest.testSuite(function() {
  const EventSet = tr.model.EventSet;
  const ObjectInstance = tr.model.ObjectInstance;

  test('instantiate_analysisWithObjects', function() {
    const model = new tr.Model();
    const p1 = model.getOrCreateProcess(1);
    const objects = p1.objects;
    const i10 = objects.idWasCreated(
        '0x1000', 'tr.e.cc', 'LayerTreeHostImpl', 10);
    const s10 = objects.addSnapshot('0x1000', 'tr.e.cc', 'LayerTreeHostImpl',
        10, 'snapshot-1');
    const s25 = objects.addSnapshot('0x1000', 'tr.e.cc', 'LayerTreeHostImpl',
        25, 'snapshot-2');
    const s40 = objects.addSnapshot('0x1000', 'tr.e.cc', 'LayerTreeHostImpl',
        40, 'snapshot-3');
    objects.idWasDeleted('0x1000', 'tr.e.cc', 'LayerTreeHostImpl', 45);

    const track = {};
    const selection = new EventSet();
    selection.push(i10);
    selection.push(s10);
    selection.push(s25);
    selection.push(s40);

    const analysisEl = document.createElement('tr-ui-a-multi-object-sub-view');
    analysisEl.selection = selection;
    this.addHTMLOutput(analysisEl);
  });
});
</script>
